

<!doctype html>

<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Appendix &#8212; RTG Tools Operations Manual v3.12</title>
    <link rel="stylesheet" href="_static/bizstyle.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/doctools.js"></script>
    <script src="_static/language_data.js"></script>
    <script src="_static/bizstyle.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="prev" title="Administration &amp; Capacity Planning" href="administration.html" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <!--[if lt IE 9]>
    <script src="_static/css3-mediaqueries.js"></script>
    <![endif]-->
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="administration.html" title="Administration &amp; Capacity Planning"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">RTG Tools Operations Manual v3.12</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">Appendix</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="appendix">
<h1>Appendix<a class="headerlink" href="#appendix" title="Permalink to this headline">¶</a></h1>
<div class="section" id="rtg-reference-file-format">
<h2>RTG reference file format<a class="headerlink" href="#rtg-reference-file-format" title="Permalink to this headline">¶</a></h2>
<p>Many RTG commands can make use of additional information about the
structure of a reference genome, such as expected ploidy, sex
chromosomes, location of PAR regions, etc.  When appropriate, this
information may be stored inside a reference genome’s SDF directory in a
file called <code class="docutils literal notranslate"><span class="pre">reference.txt</span></code>.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">format</span></code> command will automatically identify several common
reference genomes during formatting and will create a <code class="docutils literal notranslate"><span class="pre">reference.txt</span></code>
in the resulting SDF.  However, for non-human reference genomes, or less
common human reference genomes, a pre-built reference configuration file
may not be available, and will need to be manually provided in order to
make use of RTG sex-aware pipeline features.</p>
<p>Several example <code class="docutils literal notranslate"><span class="pre">reference.txt</span></code> files for different human reference
versions are included as part of the RTG distribution in the <code class="docutils literal notranslate"><span class="pre">scripts</span></code>
subdirectory, so for common reference versions it will suffice to copy
the appropriate example file into the formatted reference SDF with the
name <code class="docutils literal notranslate"><span class="pre">reference.txt</span></code>, or use one of these example files as the basis
for your specific reference genome.</p>
<p>To see how a reference text file will be interpreted by the chromosomes
in an SDF for a given sex you can use the <code class="docutils literal notranslate"><span class="pre">sdfstats</span></code> command with the
<code class="docutils literal notranslate"><span class="pre">--sex</span></code> flag. For example:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ rtg sdfstats --sex male /data/human/ref/hg19

Location            : /data/human/ref/hg19
Parameters          : format -o /data/human/ref/hg19 -I chromosomes.txt
SDF Version         : 11
Type                : DNA
Source              : UNKNOWN
Paired arm          : UNKNOWN
SDF-ID              : b6318de1-8107-4b11-bdd9-fb8b6b34c5d0
Number of sequences : 25
Maximum length      : 249250621
Minimum length      : 16571
Sequence names      : yes
N                   : 234350281
A                   : 844868045
C                   : 585017944
G                   : 585360436
T                   : 846097277
Total residues      : 3095693983
Residue qualities   : no

Sequences for sex=MALE:
chrM POLYPLOID circular 16571
chr1 DIPLOID linear 249250621
chr2 DIPLOID linear 243199373
chr3 DIPLOID linear 198022430
chr4 DIPLOID linear 191154276
chr5 DIPLOID linear 180915260
chr6 DIPLOID linear 171115067
chr7 DIPLOID linear 159138663
chr8 DIPLOID linear 146364022
chr9 DIPLOID linear 141213431
chr10 DIPLOID linear 135534747
chr11 DIPLOID linear 135006516
chr12 DIPLOID linear 133851895
chr13 DIPLOID linear 115169878
chr14 DIPLOID linear 107349540
chr15 DIPLOID linear 102531392
chr16 DIPLOID linear 90354753
chr17 DIPLOID linear 81195210
chr18 DIPLOID linear 78077248
chr19 DIPLOID linear 59128983
chr20 DIPLOID linear 63025520
chr21 DIPLOID linear 48129895
chr22 DIPLOID linear 51304566
chrX HAPLOID linear 155270560 ~=chrY
    chrX:60001-2699520 chrY:10001-2649520
    chrX:154931044-155260560 chrY:59034050-59363566
chrY HAPLOID linear 59373566 ~=chrX
    chrX:60001-2699520 chrY:10001-2649520
    chrX:154931044-155260560 chrY:59034050-59363566
</pre></div>
</div>
<p>The reference file is primarily intended for XY sex determination but
should be able to handle ZW and X0 sex determination also.</p>
<p>The following describes the reference file text format in more detail.
The file contains lines with TAB separated fields describing the
properties of the chromosomes. Comments within the <code class="docutils literal notranslate"><span class="pre">reference.txt</span></code> file
are preceded by the character <code class="docutils literal notranslate"><span class="pre">#</span></code>. The first line of the file that is
not a comment or blank must be the version line.</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>version1
</pre></div>
</div>
<p>The remaining lines have the following common structure:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>&lt;sex&gt; &lt;line-type&gt;     &lt;line-setting&gt;...
</pre></div>
</div>
<p>The sex field is one of <code class="docutils literal notranslate"><span class="pre">male</span></code>, <code class="docutils literal notranslate"><span class="pre">female</span></code> or <code class="docutils literal notranslate"><span class="pre">either</span></code>. The
line-type field is one of <code class="docutils literal notranslate"><span class="pre">def</span></code> for default sequence settings, <code class="docutils literal notranslate"><span class="pre">seq</span></code>
for specific chromosomal sequence settings and <code class="docutils literal notranslate"><span class="pre">dup</span></code> for defining
pseudo-autosomal regions. The <em>line-setting</em> fields are a variable
number of fields based on the line type given.</p>
<p>The default sequence settings line can only be specified with <code class="docutils literal notranslate"><span class="pre">either</span></code>
for the sex field, can only be specified once and must be specified if
there are not individual chromosome settings for all chromosomes and
other contigs. It is specified with the following structure:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>either        def     &lt;ploidy&gt;        &lt;shape&gt;
</pre></div>
</div>
<p>The <em>ploidy</em> field is one of <code class="docutils literal notranslate"><span class="pre">haploid</span></code>, <code class="docutils literal notranslate"><span class="pre">diploid</span></code>, <code class="docutils literal notranslate"><span class="pre">triploid</span></code>,
<code class="docutils literal notranslate"><span class="pre">tetraploid</span></code>, <code class="docutils literal notranslate"><span class="pre">pentaploid</span></code>, <code class="docutils literal notranslate"><span class="pre">hexaploid</span></code>, <code class="docutils literal notranslate"><span class="pre">polyploid</span></code> or
<code class="docutils literal notranslate"><span class="pre">none</span></code>. The <em>shape</em> field is one of <code class="docutils literal notranslate"><span class="pre">circular</span></code> or <code class="docutils literal notranslate"><span class="pre">linear</span></code>.</p>
<p>The specific chromosome settings lines are similar to the default
chromosome settings lines. All the sex field options can be used,
however for any one chromosome you can only specify a single line for
<code class="docutils literal notranslate"><span class="pre">either</span></code> or two lines for <code class="docutils literal notranslate"><span class="pre">male</span></code> and <code class="docutils literal notranslate"><span class="pre">female</span></code>. They are specified
with the following structure:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>&lt;sex&gt; seq     &lt;chromosome-name&gt;       &lt;ploidy&gt;        &lt;shape&gt; [allosome]
</pre></div>
</div>
<p>The <em>ploidy</em> and <em>shape</em> fields are the same as for the default
chromosome settings line. The <em>chromosome-name</em> field is the name of the
chromosome to which the line applies. The <em>allosome</em> field is optional
and is used to specify the allosome pair of a haploid chromosome.</p>
<p>The pseudo-autosomal region settings line can be set with any of the
<em>sex</em> field options and any number of the lines can be defined as
necessary. It has the following format:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>&lt;sex&gt; dup     &lt;region&gt;        &lt;region&gt;
</pre></div>
</div>
<p>The regions must be taken from two haploid chromosomes for a given sex,
have the same length and not go past the end of the chromosome. The
regions are given in the format <code class="docutils literal notranslate"><span class="pre">&lt;chromosome-name&gt;:&lt;start&gt;-&lt;end&gt;</span></code> where
start and end are positions counting from one and the end is
non-inclusive.</p>
<p>An example for the HG19 human reference:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span># Reference specification for hg19, see
# http://genome.ucsc.edu/cgi-bin/hgTracks?hgsid=184117983&amp;chromInfoPage=
version 1
# Unless otherwise specified, assume diploid linear. Well-formed
# chromosomes should be explicitly listed separately so this
# applies primarily to unplaced contigs and decoy sequences
either        def     diploid linear
# List the autosomal chromosomes explicitly. These are used to help
# determine &quot;normal&quot; coverage levels during mapping and variant calling
either        seq     chr1    diploid linear
either        seq     chr2    diploid linear
either        seq     chr3    diploid linear
either        seq     chr4    diploid linear
either        seq     chr5    diploid linear
either        seq     chr6    diploid linear
either        seq     chr7    diploid linear
either        seq     chr8    diploid linear
either        seq     chr9    diploid linear
either        seq     chr10   diploid linear
either        seq     chr11   diploid linear
either        seq     chr12   diploid linear
either        seq     chr13   diploid linear
either        seq     chr14   diploid linear
either        seq     chr15   diploid linear
either        seq     chr16   diploid linear
either        seq     chr17   diploid linear
either        seq     chr18   diploid linear
either        seq     chr19   diploid linear
either        seq     chr20   diploid linear
either        seq     chr21   diploid linear
either        seq     chr22   diploid linear
# Define how the male and female get the X and Y chromosomes
male  seq     chrX    haploid linear  chrY
male  seq     chrY    haploid linear  chrX
female        seq     chrX    diploid linear
female        seq     chrY    none    linear
#PAR1 pseudoautosomal region
male  dup     chrX:60001-2699520      chrY:10001-2649520
#PAR2 pseudoautosomal region
male  dup     chrX:154931044-155260560        chrY:59034050-59363566
# And the mitochondria
either        seq     chrM    polyploid       circular
</pre></div>
</div>
<p>As of the current version of the RTG software the following are the
effects of various settings in the <code class="docutils literal notranslate"><span class="pre">reference.txt</span></code> file when processing
a sample with the matching sex.</p>
<p>A ploidy setting of <code class="docutils literal notranslate"><span class="pre">none</span></code> will prevent reads from mapping to that
chromosome and any variant calling from being done in that chromosome.</p>
<p>A ploidy setting of <code class="docutils literal notranslate"><span class="pre">diploid</span></code>, <code class="docutils literal notranslate"><span class="pre">haploid</span></code> or <code class="docutils literal notranslate"><span class="pre">polyploid</span></code> does not
currently affect the output of mapping.</p>
<p>A ploidy setting of <code class="docutils literal notranslate"><span class="pre">diploid</span></code> will treat the chromosome as having two
distinct copies during variant calling, meaning that both homozygous and
heterozygous diploid genotypes may be called for the chromosome.</p>
<p>A ploidy setting of <code class="docutils literal notranslate"><span class="pre">haploid</span></code> will treat the chromosome as having one
copy during variant calling, meaning that only haploid genotypes will be
called for the chromosome.</p>
<p>A ploidy setting of <code class="docutils literal notranslate"><span class="pre">polyploid</span></code> will treat the chromosome as having one
copy during variant calling, meaning that only haploid genotypes will be
called for the chromosome. For variant calling with a pedigree, maternal
inheritance is assumed for polyploid sequences.</p>
<p>The shape of the chromosome does not currently affect the output of
mapping or variant calling.</p>
<p>The allosome pairs do not currently affect the output of mapping or
variant calling (but are used by simulated data generation commands).</p>
<p>The pseudo-autosomal regions will cause the second half of the region
pair to be skipped during mapping. During variant calling the first half
of the region pair will be called as diploid and the second half will
not have calls made for it. For the example <code class="docutils literal notranslate"><span class="pre">reference.txt</span></code> provided
earlier this means that when mapping a male the X chromosome sections of
the pseudo-autosomal regions will be mapped to exclusively and for
variant calling the X chromosome sections will be called as diploid
while the Y chromosome sections will be skipped. There may be some edge
effects up to a read length either side of a pseudo-autosomal region
boundary.</p>
</div>
<div class="section" id="pedigree-ped-input-file-format">
<h2>Pedigree PED input file format<a class="headerlink" href="#pedigree-ped-input-file-format" title="Permalink to this headline">¶</a></h2>
<p>The PED file format is a white space (tab or space) delimited ASCII
file. Lines starting with <code class="docutils literal notranslate"><span class="pre">#</span></code> are ignored. It has exactly six required
columns in the following order.</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Column</p></th>
<th class="head"><p>Definition</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><em>Family ID</em></p></td>
<td><p>Alphanumeric ID of a family group. This field is ignored by RTG commands.</p></td>
</tr>
<tr class="row-odd"><td><p><em>Individual ID</em></p></td>
<td><p>Alphanumeric ID of an individual. This corresponds to the Sample ID specified in the read group of the individual (<code class="docutils literal notranslate"><span class="pre">SM</span></code> field).</p></td>
</tr>
<tr class="row-even"><td><p><em>Paternal ID</em></p></td>
<td><p>Alphanumeric ID of the paternal parent for the individual. This corresponds to the Sample ID specified in the read group of the paternal parent (<code class="docutils literal notranslate"><span class="pre">SM</span></code> field).</p></td>
</tr>
<tr class="row-odd"><td><p><em>Maternal ID</em></p></td>
<td><p>Alphanumeric ID of the maternal parent for the individual. This corresponds to the Sample ID specified in the read group of the maternal parent (<code class="docutils literal notranslate"><span class="pre">SM</span></code> field).</p></td>
</tr>
<tr class="row-even"><td><p><em>Sex</em></p></td>
<td><p>The sex of the individual specified as using 1 for male, 2 for female and any other number as unknown.</p></td>
</tr>
<tr class="row-odd"><td><p><em>Phenotype</em></p></td>
<td><p>The phenotype of the individual specified using -9 or 0 for unknown, 1 for unaffected and 2 for affected.</p></td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The PED format is based on the PED format defined by
the PLINK project:
<a class="reference external" href="http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#ped">http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#ped</a></p>
</div>
<p>The value ‘0’ can be used as a missing value for Family ID, Paternal ID
and Maternal ID.</p>
<p>The following is an example of what a PED file may look like.</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span># PED format pedigree
# fam-id ind-id pat-id mat-id sex phen
FAM01 NA19238 0 0 2 0
FAM01 NA19239 0 0 1 0
FAM01 NA19240 NA19239 NA19238 2 0
0 NA12878 0 0 2 0
</pre></div>
</div>
<p>When specifying a pedigree for the <code class="docutils literal notranslate"><span class="pre">lineage</span></code> command, use either the
pat-id or mat-id as appropriate to the gender of the sample cell
lineage. The following is an example of what a cell lineage PED file may
look like.</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span># PED format pedigree
# fam-id ind-id pat-id mat-id sex phen
LIN BASE 0 0 2 0
LIN GENA 0 BASE 2 0
LIN GENB 0 BASE 2 0
LIN GENA-A 0 GENA 2 0
</pre></div>
</div>
<p>RTG includes commands such as <code class="docutils literal notranslate"><span class="pre">pedfilter</span></code> and <code class="docutils literal notranslate"><span class="pre">pedstats</span></code> for simple
viewing, filtering and conversion of pedigree files.</p>
</div>
<div class="section" id="genetic-map-directory">
<h2>Genetic map directory<a class="headerlink" href="#genetic-map-directory" title="Permalink to this headline">¶</a></h2>
<p>Certain commands such as <code class="docutils literal notranslate"><span class="pre">pedsamplesim</span></code> are able to make use of genetic
linkage information provided in the form of per sequence TSV files in
a directory.</p>
<p>Such files must be tab separated with a single header line.  The header
line must include the columns <code class="docutils literal notranslate"><span class="pre">pos</span></code> and <code class="docutils literal notranslate"><span class="pre">cM</span></code> (for centimorgans).  A
<code class="docutils literal notranslate"><span class="pre">chr</span></code> column is also recommended, but not essential.  Other columns
may be present, but are ignored.</p>
<p>For example, the start of such a file for <code class="docutils literal notranslate"><span class="pre">chr1</span></code> is:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>chr     pos     rate            cM
chr1    6079392 0.0453026       0
chr1    6085392 0.0696987       0.0002718156
chr1    6088671 0.719604        0.0005003576373
chr1    6095199 0.203332        0.0051979325493
chr1    6098266 0.250261        0.0058215517933
</pre></div>
</div>
<p>The columns in the example are:</p>
<ol class="arabic simple">
<li><p>Chromosome name</p></li>
<li><p>Position in chromosome</p></li>
<li><p>Rate of crossovers in region ending at this position (ignored)</p></li>
<li><p>Total number of centimorgans from start of sequence</p></li>
</ol>
<p>The corresponding map directory should contain a file or files for each sequence
of interest, using the naming convention
<code class="docutils literal notranslate"><span class="pre">[</span></code><em>sex</em><code class="docutils literal notranslate"><span class="pre">.]</span></code><em>sequence</em><code class="docutils literal notranslate"><span class="pre">.map</span></code>
where <em>sex</em> is an optional sex specification (either <code class="docutils literal notranslate"><span class="pre">male</span></code> or <code class="docutils literal notranslate"><span class="pre">female</span></code>)
and <em>sequence</em> is the name of the sequence, for example <code class="docutils literal notranslate"><span class="pre">chr1</span></code>.</p>
<p>When loading these files, an attempt is first made to load the file
corresponding to the sex of the sample being processed.  If that file
does not exist, then an attempt is made to load a nonspecific version
of the file.  If that also does not exist, then a uniform distribution
will be assumed.  For example, if processing a female sample for <code class="docutils literal notranslate"><span class="pre">chr1</span></code>,
first <code class="docutils literal notranslate"><span class="pre">female.chr1.map</span></code> will be tested.  If that does not exist, then
<code class="docutils literal notranslate"><span class="pre">chr1.map</span></code> will be tested. If that also does not exist, then the
uniform distribution will be used. In this way as many or as few sequences
as desired may be covered within a particular directory.</p>
<p>For the human genome, several sources of appropriate linkage information
are available.  Please note that it will generally be necessary to add
headers and possibly make other adjustments to these files before they
can be used with RTG.</p>
<p>Specific sources include:</p>
<ul class="simple">
<li><p><a class="reference external" href="https://github.com/cbherer/Bherer_etal_SexualDimorphismRecombination">https://github.com/cbherer/Bherer_etal_SexualDimorphismRecombination</a></p></li>
<li><p><a class="reference external" href="https://genome.sph.umich.edu/wiki/Polymutt2">https://genome.sph.umich.edu/wiki/Polymutt2</a></p></li>
<li><p><a class="reference external" href="http://bochet.gcc.biostat.washington.edu/beagle/genetic_maps/">http://bochet.gcc.biostat.washington.edu/beagle/genetic_maps/</a></p></li>
</ul>
<p>A zip file containing the Bherer genetic map files for human build 37,
with the required header manipulations already applied is available for
download from: <a class="reference external" href="https://realtimegenomics.com/news/pre-formatted-reference-datasets">https://realtimegenomics.com/news/pre-formatted-reference-datasets</a></p>
<p>See <a class="reference internal" href="rtg_command_reference.html#pedsamplesim"><span class="std std-ref">pedsamplesim</span></a>, <a class="reference internal" href="rtg_command_reference.html#childsim"><span class="std std-ref">childsim</span></a>.</p>
</div>
<div class="section" id="rtg-commands-using-indexed-input-files">
<h2>RTG commands using indexed input files<a class="headerlink" href="#rtg-commands-using-indexed-input-files" title="Permalink to this headline">¶</a></h2>
<p>Several RTG commands require coordinate indexed input files to operate
and several more require them when the <code class="docutils literal notranslate"><span class="pre">--region</span></code> or <code class="docutils literal notranslate"><span class="pre">--bed-regions</span></code>
parameter is used. The index files used are standard tabix or BAM index
files.</p>
<p>The RTG commands which produce the inputs used by these commands will by
default produce them with appropriate index files. To produce indexes
for files from third party sources or RTG command output where the
<code class="docutils literal notranslate"><span class="pre">--no-index</span></code> or <code class="docutils literal notranslate"><span class="pre">--no-gzip</span></code> parameters were set, use the RTG
<code class="docutils literal notranslate"><span class="pre">bgzip</span></code> and <code class="docutils literal notranslate"><span class="pre">index</span></code> commands.</p>
</div>
<div class="section" id="rtg-javascript-filtering-api">
<h2>RTG JavaScript filtering API<a class="headerlink" href="#rtg-javascript-filtering-api" title="Permalink to this headline">¶</a></h2>
<p>The <code class="docutils literal notranslate"><span class="pre">vcffilter</span></code> command permits filtering VCF records via user-supplied
JavaScript expressions or scripts containing JavaScript functions that
operate on VCF records. The JavaScript environment has an API provided
that enables convenient access to components of a VCF record in order to
satisfy common use cases.</p>
<div class="section" id="vcf-record-field-access">
<h3>VCF record field access<a class="headerlink" href="#vcf-record-field-access" title="Permalink to this headline">¶</a></h3>
<p>This section describes the supported methods to access components of an
individual VCF record. In the following descriptions, assume the input
VCF contains the following excerpt (the full header has been omitted):</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NA12877 NA12878
1 11259340 . G C,T . PASS DP=795;DPR=0.581;ABC=4.5 GT:DP 1/2:65 1/0:15
</pre></div>
</div>
<div class="section" id="chrom-pos-id-ref-qual">
<h4>CHROM, POS, ID, REF, QUAL<a class="headerlink" href="#chrom-pos-id-ref-qual" title="Permalink to this headline">¶</a></h4>
<p>Within the context of a <code class="docutils literal notranslate"><span class="pre">--keep-expr</span></code> or <code class="docutils literal notranslate"><span class="pre">record</span></code> function these
variables will provide access to the String representation of the VCF
column of the same name.</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="nx">CHROM</span><span class="p">;</span> <span class="c1">// &quot;1&quot;</span>
<span class="nx">POS</span><span class="p">;</span> <span class="c1">// &quot;11259340&quot;</span>
<span class="nx">ID</span><span class="p">;</span> <span class="c1">// &quot;.&quot;</span>
<span class="nx">REF</span><span class="p">;</span> <span class="c1">// &quot;G&quot;</span>
<span class="nx">QUAL</span><span class="p">;</span> <span class="c1">// &quot;.&quot;</span>
</pre></div>
</div>
</div>
<div class="section" id="alt-filter">
<h4>ALT, FILTER<a class="headerlink" href="#alt-filter" title="Permalink to this headline">¶</a></h4>
<p>Will retrieve an array of the values in the column.</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="nx">ALT</span><span class="p">;</span> <span class="c1">// [&quot;C&quot;, &quot;T&quot;]</span>
<span class="nx">FILTER</span><span class="p">;</span> <span class="c1">// [&quot;PASS&quot;]</span>
</pre></div>
</div>
</div>
<div class="section" id="info-info-field">
<h4>INFO.{INFO_FIELD}<a class="headerlink" href="#info-info-field" title="Permalink to this headline">¶</a></h4>
<p>The values in the <code class="docutils literal notranslate"><span class="pre">INFO</span></code> field are accessible through properties on the
<code class="docutils literal notranslate"><span class="pre">INFO</span></code> object indexed by <code class="docutils literal notranslate"><span class="pre">INFO</span> <span class="pre">ID</span></code>. These properties will be the string
representation of info values with multiple values delimited with “<code class="docutils literal notranslate"><span class="pre">,</span></code>”.
Missing fields will be represented by “<code class="docutils literal notranslate"><span class="pre">.</span></code>”. Assigning to these
properties will update the VCF record. This will be undefined for fields not
declared in the header.</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="nx">INFO</span><span class="p">.</span><span class="nx">DP</span><span class="p">;</span> <span class="c1">// &quot;795&quot;</span>
<span class="nx">INFO</span><span class="p">.</span><span class="nx">ABC</span><span class="p">;</span> <span class="c1">// &quot;4,5&quot;</span>
</pre></div>
</div>
</div>
<div class="section" id="sample-name-format-field">
<h4>{SAMPLE_NAME}.{FORMAT_FIELD}<a class="headerlink" href="#sample-name-format-field" title="Permalink to this headline">¶</a></h4>
<p>The JavaScript String prototype has been extended to allow access to the
format fields for each sample. The string representation of values in
the sample column are accessible as properties on the string matching
the sample name named after the <code class="docutils literal notranslate"><span class="pre">FORMAT</span></code> field <code class="docutils literal notranslate"><span class="pre">ID</span></code>.</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="s1">&#39;NA12877&#39;</span><span class="p">.</span><span class="nx">GT</span><span class="p">;</span> <span class="c1">// &quot;1/2&quot;</span>
<span class="s1">&#39;NA12878&#39;</span><span class="p">.</span><span class="nx">GT</span><span class="p">;</span> <span class="c1">// &quot;1/0&quot;</span>
</pre></div>
</div>
<p>Note that these properties are only defined for fields that are declared
in the VCF header (any that are not declared in the header will be
undefined). See below for how to add new <code class="docutils literal notranslate"><span class="pre">INFO</span></code> or <code class="docutils literal notranslate"><span class="pre">FORMAT</span></code> field
declarations.</p>
</div>
</div>
<div class="section" id="vcf-record-modification">
<h3>VCF record modification<a class="headerlink" href="#vcf-record-modification" title="Permalink to this headline">¶</a></h3>
<p>Most components of VCF records can be written or updated in a fairly
natural manner by direct assignment in order to make modifications. For
example:</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="nx">CHROM</span> <span class="o">=</span> <span class="s2">&quot;chr1&quot;</span><span class="p">;</span>      <span class="c1">// Will change the CHROM value</span>
<span class="nx">POS</span> <span class="o">=</span> <span class="mi">42</span><span class="p">;</span>            <span class="c1">// Will change the POS value</span>
<span class="nx">ID</span> <span class="o">=</span> <span class="s2">&quot;rs23987382&quot;</span><span class="p">;</span>   <span class="c1">// Will change the ID value</span>
<span class="nx">QUAL</span> <span class="o">=</span> <span class="s2">&quot;50&quot;</span><span class="p">;</span>         <span class="c1">// Will change the QUAL value</span>
<span class="nx">FILTER</span> <span class="o">=</span> <span class="s2">&quot;FAIL&quot;</span><span class="p">;</span>     <span class="c1">// Will set the FILTER value</span>
<span class="nx">INFO</span><span class="p">.</span><span class="nx">DPR</span> <span class="o">=</span> <span class="s2">&quot;0.01&quot;</span><span class="p">;</span>   <span class="c1">// Will change the value of the DPR info field</span>
<span class="s1">&#39;NA12877&#39;</span><span class="p">.</span><span class="nx">DP</span> <span class="o">=</span> <span class="s2">&quot;10&quot;</span><span class="p">;</span> <span class="c1">// Will change the DP field of the NA12877 sample</span>
</pre></div>
</div>
<p>Other components of the VCF record (such as <code class="docutils literal notranslate"><span class="pre">REF</span></code>,
and <code class="docutils literal notranslate"><span class="pre">ALT</span></code>) are considered immutable and can not currently be altered.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Modification of <code class="docutils literal notranslate"><span class="pre">CHROM</span></code> and/or <code class="docutils literal notranslate"><span class="pre">POS</span></code> can lead to a VCF file
which is incorrectly sorted and this will not necessarily be detected
or reported until the resulting VCF file is used with another module
or tool.  Depending on the new value assigned to <code class="docutils literal notranslate"><span class="pre">CHROM</span></code> it may
also be necessary to modify the sequence dictionary in the VCF
header to reflect the change (see <a class="reference internal" href="#vcf-header-modification"><span class="std std-ref">VCF header modification</span></a>).</p>
</div>
<p>Direct assignment to <code class="docutils literal notranslate"><span class="pre">ID</span></code> and <code class="docutils literal notranslate"><span class="pre">FILTER</span></code> fields accept either a string
containing semicolon separated values, or a list of values. For example:</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="nx">ID</span> <span class="o">=</span> <span class="s1">&#39;rs23987382;COSM3805&#39;</span><span class="p">;</span>
<span class="nx">ID</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;rs23987382&#39;</span><span class="p">,</span> <span class="s1">&#39;COSM3805&#39;</span><span class="p">];</span>
<span class="nx">FILTER</span> <span class="o">=</span> <span class="s1">&#39;BAZ;BANG&#39;</span><span class="p">;</span>
<span class="nx">FILTER</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;BAZ&#39;</span><span class="p">,</span> <span class="s1">&#39;BANG&#39;</span><span class="p">];</span>
</pre></div>
</div>
<p>Note that although the <code class="docutils literal notranslate"><span class="pre">FILTER</span></code> field returns an array when read, any
changes made to this array directly are not reflected back into the VCF
record.</p>
<p>Adding a filter to existing filters is a common operation and can be
accomplished by the above assignment methods, for example by adding a
value to the existing list and then setting the result:</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="kd">var</span> <span class="nx">f</span> <span class="o">=</span> <span class="nx">FILTER</span><span class="p">;</span>
<span class="nx">f</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="s1">&#39;BOING&#39;</span><span class="p">);</span>
<span class="nx">FILTER</span> <span class="o">=</span> <span class="nx">f</span><span class="p">;</span>
</pre></div>
</div>
<p>However, since this is a little unwieldy, a convenience function called
<cite>add()</cite> can be used (and may be chained):</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="nx">FILTER</span><span class="p">.</span><span class="nx">add</span><span class="p">(</span><span class="s1">&#39;BOING&#39;</span><span class="p">);</span>
<span class="nx">FILTER</span><span class="p">.</span><span class="nx">add</span><span class="p">([</span><span class="s1">&#39;BOING&#39;</span><span class="p">,</span> <span class="s1">&#39;DOING&#39;</span><span class="p">);</span>
<span class="nx">FILTER</span><span class="p">.</span><span class="nx">add</span><span class="p">(</span><span class="s1">&#39;BOING&#39;</span><span class="p">).</span><span class="nx">add</span><span class="p">(</span><span class="s1">&#39;DOING&#39;</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="vcf-header-modification">
<h3>VCF header modification<a class="headerlink" href="#vcf-header-modification" title="Permalink to this headline">¶</a></h3>
<p>Functions are provided that allow the addition of new <code class="docutils literal notranslate"><span class="pre">FILTER</span></code>,
<code class="docutils literal notranslate"><span class="pre">INFO</span></code> and <code class="docutils literal notranslate"><span class="pre">FORMAT</span></code> fields to the header and records. It is
recommended that the following functions only be used within the
run-once portion of <code class="docutils literal notranslate"><span class="pre">--javascript</span></code>.</p>
<div class="section" id="ensureformatheader-format-header-string">
<h4>ensureFormatHeader({FORMAT_HEADER_STRING})<a class="headerlink" href="#ensureformatheader-format-header-string" title="Permalink to this headline">¶</a></h4>
<p>Add a new <code class="docutils literal notranslate"><span class="pre">FORMAT</span></code> field to the VCF if it is not already present. This
will add a <code class="docutils literal notranslate"><span class="pre">FORMAT</span></code> declaration line to the header and define the
corresponding accessor methods for use in record processing.</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="nx">ensureFormatHeader</span><span class="p">(</span><span class="s1">&#39;##FORMAT=&lt;ID=GL,Number=G,Type=Float,&#39;</span> <span class="o">+</span>
  <span class="s1">&#39;Description=&quot;Log_10 scaled genotype likelihoods.&quot;&gt;&#39;</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="ensureinfoheader-info-header-string">
<h4>ensureInfoHeader({INFO_HEADER_STRING})<a class="headerlink" href="#ensureinfoheader-info-header-string" title="Permalink to this headline">¶</a></h4>
<p>Add a new <code class="docutils literal notranslate"><span class="pre">INFO</span></code> field to the VCF if it is not already present. This
will add an <code class="docutils literal notranslate"><span class="pre">INFO</span></code> declaration line to the header and define the
corresponding accessor methods for use in record processing.</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="nx">ensureInfoHeader</span><span class="p">(</span><span class="s1">&#39;##INFO=&lt;ID=CT,Number=1,Type=Integer,&#39;</span> <span class="o">+</span>
  <span class="s1">&#39;Description=&quot;Coverage threshold that was applied&quot;&gt;&#39;</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="ensurefilterheader-filter-header-string">
<h4>ensureFilterHeader({FILTER_HEADER_STRING})<a class="headerlink" href="#ensurefilterheader-filter-header-string" title="Permalink to this headline">¶</a></h4>
<p>Add a new <code class="docutils literal notranslate"><span class="pre">FILTER</span></code> field to the VCF header if it is not already
present. This will add an <code class="docutils literal notranslate"><span class="pre">FILTER</span></code> declaration line to the header.</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="nx">ensureFilterHeader</span><span class="p">(</span><span class="s1">&#39;##INFO=&lt;ID=FAIL_VAL,&#39;</span> <span class="o">+</span>
  <span class="s1">&#39;Description=&quot;Failed validation&quot;&gt;&#39;</span><span class="p">);</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="testing-for-overlap-with-genomic-regions">
<h3>Testing for overlap with genomic regions<a class="headerlink" href="#testing-for-overlap-with-genomic-regions" title="Permalink to this headline">¶</a></h3>
<p>One common use case is to test whether any given VCF record overlaps or
is contained within a set of genomic regions. Regions may be loaded from
either an external BED file or VCF file in the run-once portion of the
JavaScript by either of the following:</p>
<div class="section" id="regions-frombed-filename">
<h4>Regions.fromBed({FILENAME})<a class="headerlink" href="#regions-frombed-filename" title="Permalink to this headline">¶</a></h4>
<p>Load the specified BED file into a <cite>regions</cite> object. For example:</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="kd">var</span> <span class="nx">myregions</span> <span class="o">=</span> <span class="nx">Regions</span><span class="p">.</span><span class="nx">fromBed</span><span class="p">(</span><span class="s1">&#39;/path/to/regions.bed&#39;</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="regions-fromvcf-filename">
<h4>Regions.fromVcf({FILENAME})<a class="headerlink" href="#regions-fromvcf-filename" title="Permalink to this headline">¶</a></h4>
<p>Load the specified VCF file into a <cite>regions</cite> object. For example:</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="kd">var</span> <span class="nx">myregions</span> <span class="o">=</span> <span class="nx">Regions</span><span class="p">.</span><span class="nx">fromVcf</span><span class="p">(</span><span class="s1">&#39;/path/to/regions.vcf&#39;</span><span class="p">);</span>
</pre></div>
</div>
<p>Having loaded a set of genomic regions, this can be used to test for
region overlaps using the following methods:</p>
</div>
<div class="section" id="regions-object-overlaps-chrom-start-end">
<h4>{REGIONS_OBJECT}.overlaps({CHROM}, {START}, {END})<a class="headerlink" href="#regions-object-overlaps-chrom-start-end" title="Permalink to this headline">¶</a></h4>
<p>Return true if the loaded regions overlap the specified interval.  This
function is typically used within the <code class="docutils literal notranslate"><span class="pre">record</span></code> function to test the
coordinates of the current VCF record, e.g.:</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="kd">function</span> <span class="nx">record</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">if</span> <span class="p">(</span><span class="nx">myregions</span><span class="p">.</span><span class="nx">overlaps</span><span class="p">(</span><span class="nx">CHROM</span><span class="p">,</span> <span class="nx">POS</span><span class="p">,</span> <span class="nx">POS</span> <span class="o">+</span> <span class="nx">REF</span><span class="p">.</span><span class="nx">length</span><span class="p">))</span> <span class="p">{</span>
        <span class="c1">// do something if the record overlaps any region</span>
    <span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="regions-object-encloses-chrom-start-end">
<h4>{REGIONS_OBJECT}.encloses({CHROM}, {START}, {END})<a class="headerlink" href="#regions-object-encloses-chrom-start-end" title="Permalink to this headline">¶</a></h4>
<p>Return true if the loaded regions entirely encloses the supplied
interval.  This function is typically used within the <code class="docutils literal notranslate"><span class="pre">record</span></code>
function to test the coordinates of the current VCF record, e.g.:</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="kd">function</span> <span class="nx">record</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">if</span> <span class="p">(</span><span class="nx">myregions</span><span class="p">.</span><span class="nx">encloses</span><span class="p">(</span><span class="nx">CHROM</span><span class="p">,</span> <span class="nx">POS</span><span class="p">,</span> <span class="nx">POS</span> <span class="o">+</span> <span class="nx">REF</span><span class="p">.</span><span class="nx">length</span><span class="p">))</span> <span class="p">{</span>
        <span class="c1">// do something if the record is fully enclosed by any region</span>
    <span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="additional-information-and-functions">
<h3>Additional information and functions<a class="headerlink" href="#additional-information-and-functions" title="Permalink to this headline">¶</a></h3>
<div class="section" id="samples">
<h4>SAMPLES<a class="headerlink" href="#samples" title="Permalink to this headline">¶</a></h4>
<p>This variable contains an array of the sample names in the VCF header.</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="nx">SAMPLES</span><span class="p">;</span> <span class="c1">// [&#39;NA12877&#39;, &#39;NA12878&#39;]</span>
</pre></div>
</div>
</div>
<div class="section" id="print-string">
<h4>print({STRING})<a class="headerlink" href="#print-string" title="Permalink to this headline">¶</a></h4>
<p>Write the provided string to standard output.</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="nx">print</span><span class="p">(</span><span class="s1">&#39;The samples are: &#39;</span> <span class="o">+</span> <span class="nx">SAMPLES</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="error-string">
<h4>error({STRING})<a class="headerlink" href="#error-string" title="Permalink to this headline">¶</a></h4>
<p>Write the provided string to standard error.</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="nx">error</span><span class="p">(</span><span class="s1">&#39;The samples are: &#39;</span> <span class="o">+</span> <span class="nx">SAMPLES</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="checkminversion-rtg-minimum-version">
<h4>checkMinVersion(RTG_MINIMUM_VERSION)<a class="headerlink" href="#checkminversion-rtg-minimum-version" title="Permalink to this headline">¶</a></h4>
<p>Check the version of RTG that the script is running under, and exits
with an error message if the version of RTG does not meet the minimum
required version. This is useful when distributing scripts that make use
of features that are not present in earlier versions of RTG.</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="nx">checkMinVersion</span><span class="p">(</span><span class="s1">&#39;3.9.2&#39;</span><span class="p">);</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p>For javascript filtering usage and examples see <a class="reference internal" href="rtg_command_reference.html#vcffilter"><span class="std std-ref">vcffilter</span></a></p>
</div>
</div>
</div>
</div>
<div class="section" id="distribution-contents">
<h2>Distribution Contents<a class="headerlink" href="#distribution-contents" title="Permalink to this headline">¶</a></h2>
<p>The contents of the RTG distribution zip file should include:</p>
<ul class="simple">
<li><p>The RTG executable JAR file.</p></li>
<li><p>RTG executable wrapper script.</p></li>
<li><p>Example scripts and files.</p></li>
<li><p>This operations manual.</p></li>
<li><p>A release notes file and a readme file.</p></li>
</ul>
<p>Some distributions also include an appropriate java runtime environment
(JRE) for your operating system.</p>
</div>
<div class="section" id="readme-txt">
<h2>README.txt<a class="headerlink" href="#readme-txt" title="Permalink to this headline">¶</a></h2>
<p>For reference purposes, a copy of the distribution <code class="docutils literal notranslate"><span class="pre">README.txt</span></code> file
follows:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>=== RTG.VERSION ===

RTG software from Real Time Genomics includes tools for the processing
and analysis of plant, animal and human sequence data from high
throughput sequencing systems.  Product usage and administration is
described in the accompanying RTG Operations Manual.


Quick Start Instructions
========================

RTG software is delivered as a command-line Java application accessed
via a wrapper script that allows a user to customize initial memory
allocation and other configuration options. It is recommended that
these wrapper scripts be used rather than directly accessing the Java
JAR.

For individual use, follow these quick start instructions.

No-JRE:

  The no-JRE distribution does not include a Java Runtime Environment
  and instead uses the system-installed Java.  Ensure that at the
  command line you can enter &quot;java -version&quot; and that this command
  reports a java version of 1.7 or higher before proceeding with the
  steps below. This may require setting your PATH environment variable
  to include the location of an appropriate version of java.

Linux/MacOS X:

  Unzip the RTG distribution to the desired location.

  If your RTG distribution requires a license file (rtg-license.txt),
  copy the license file from Real Time Genomics into the RTG
  distribution directory.

  In a terminal, cd to the installation directory and test for success
  by entering &quot;./rtg version&quot;

  On MacOS X, depending on your operating system version and
  configuration regarding unsigned applications, you may encounter the
  error message:

  -bash: rtg: /usr/bin/env: bad interpreter: Operation not permitted

  If this occurs, you must clear the OS X quarantine attribute with
  the command:

  xattr -d com.apple.quarantine rtg

  The first time rtg is executed you will be prompted with some
  questions to customize your installation. Follow the prompts.

  Enter &quot;./rtg help&quot; for a list of rtg commands.  Help for any individual
  command is available using the --help flag, e.g.: &quot;./rtg format --help&quot;

  By default, RTG software scripts establish a memory space of 90% of
  the available RAM - this is automatically calculated.  One may
  override this limit in the rtg.cfg settings file or on a per-run
  basis by supplying RTG_MEM as an environment variable or as the
  first program argument, e.g.: &quot;./rtg RTG_MEM=48g map&quot;

  [OPTIONAL] If you will be running rtg on multiple machines and would
  like to customize settings on a per-machine basis, copy
  rtg.cfg to /etc/rtg.cfg, editing per-machine settings
  appropriately (requires root privileges).  An alternative that does
  not require root privileges is to copy rtg.example.cfg to
  rtg.HOSTNAME.cfg, editing per-machine settings appropriately, where
  HOSTNAME is the short host name output by the command &quot;hostname -s&quot;

Windows:

  Unzip the RTG distribution to the desired location.

  If your RTG distribution requires a license file (rtg-license.txt),
  copy the license file from Real Time Genomics into the RTG
  distribution directory.

  Test for success by entering &quot;rtg version&quot; at the command line.  The
  first time rtg is executed you will be prompted with some
  questions to customize your installation. Follow the prompts.

  Enter &quot;rtg help&quot; for a list of rtg commands.  Help for any individual
  command is available using the --help flag, e.g.: &quot;rtg format --help&quot;

  By default, RTG software scripts establish a memory space of 90% of
  the available RAM - this is automatically calculated.  One may
  override this limit by setting the RTG_MEM variable in the rtg.bat
  script or as an environment variable.


The scripts subdirectory contains demos, helper scripts, and example
configuration files, and comprehensive documentation is contained in
the RTG Operations Manual.

Using the above quick start installation steps, an individual can
execute RTG software in a remote computing environment without the
need to establish root privileges.  Include the necessary data files
in directories within the workspace and upload the entire workspace to
the remote system (either stand-alone or cluster).

For data center deployment and instructions for editing scripts,
please consult the Administration chapter of the RTG Operations Manual.

A discussion group is now available for general questions, tips, and other
discussions. It may be viewed or joined at:
https://groups.google.com/a/realtimegenomics.com/forum/#!forum/rtg-users

To be informed of new software releases, subscribe to the low-traffic
rtg-announce group at:
https://groups.google.com/a/realtimegenomics.com/forum/#!forum/rtg-announce

Citing RTG
==========

John G. Cleary, Ross Braithwaite, Kurt Gaastra, Brian S. Hilbush,
Stuart Inglis, Sean A. Irvine, Alan Jackson, Richard Littin, Sahar
Nohzadeh-Malakshah, Mehul Rathod, David Ware, Len Trigg, and Francisco
M. De La Vega. &quot;Joint Variant and De Novo Mutation Identification on
Pedigrees from High-Throughput Sequencing Data.&quot; Journal of
Computational Biology. June 2014, 21(6):
405-419. doi:10.1089/cmb.2014.0029.

Terms of Use
============

This proprietary software program is the property of Real Time
Genomics.  All use of this software program is subject to the
terms of an applicable end user license agreement.

Patents
=======

US: 7,640,256, 13/129,329, 13/681,046, 13/681,215, 13/848,653,
13/925,704, 14/015,295, 13/971,654, 13/971,630, 14/564,810
UK: 1222923.3, 1222921.7, 1304502.6, 1311209.9, 1314888.7, 1314908.3
New Zealand: 626777, 626783, 615491, 614897, 614560
Australia: 2005255348, Singapore: 128254
Other patents pending


Third Party Software Used
=========================

RTG software uses the open source htsjdk library
(https://github.com/samtools/htsjdk) for reading and writing SAM
files, under the terms of following license:

The MIT License

Copyright (c) 2009 The Broad Institute

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the &quot;Software&quot;), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

-------------------------

RTG software uses the bzip2 library included in the open source Ant project
(http://ant.apache.org/) for decompressing bzip2 format files, under the
following license:

Copyright 1999-2010 The Apache Software Foundation

Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.

-------------------------

RTG Software uses a modified version of
java/util/zip/GZIPInputStream.java (available in the accompanying
gzipfix.jar) from OpenJDK 7 under the terms of the following license:

This code is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 only, as
published by the Free Software Foundation.  Oracle designates this
particular file as subject to the &quot;Classpath&quot; exception as provided
by Oracle in the LICENSE file that accompanied this code.

This code is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
version 2 for more details (a copy is included in the LICENSE file that
accompanied this code).

You should have received a copy of the GNU General Public License version
2 along with this work; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.

Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
or visit http://www.oracle.com if you need additional information or have
any questions.

-------------------------

RTG Software uses hierarchical data visualization software from
http://sourceforge.net/projects/krona/ under the terms of the
following license:

Copyright (c) 2011, Battelle National Biodefense Institute (BNBI);
all rights reserved. Authored by: Brian Ondov, Nicholas Bergman, and
Adam Phillippy

This Software was prepared for the Department of Homeland Security
(DHS) by the Battelle National Biodefense Institute, LLC (BNBI) as
part of contract HSHQDC-07-C-00020 to manage and operate the National
Biodefense Analysis and Countermeasures Center (NBACC), a Federally
Funded Research and Development Center.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
  notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright
  notice, this list of conditions and the following disclaimer in the
  documentation and/or other materials provided with the distribution.

* Neither the name of the Battelle National Biodefense Institute nor
  the names of its contributors may be used to endorse or promote
  products derived from this software without specific prior written
  permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
&quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</pre></div>
</div>
</div>
<div class="section" id="notice">
<h2>Notice<a class="headerlink" href="#notice" title="Permalink to this headline">¶</a></h2>
<p>Real Time Genomics does not assume any liability arising out of the
application or use of any software described herein. Further, Real Time
Genomics does not convey any license under its patent, trademark,
copyright, or common-law rights nor the similar rights of others.</p>
<p>Real Time Genomics reserves the right to make any changes in any
processes, products, or parts thereof, described herein, without
notice. While every effort has been made to make this guide as complete
and accurate as possible as of the publication date, no warranty of
fitness is implied.</p>
<p>© 2017 Real Time Genomics All rights reserved.</p>
<p>Illumina, Solexa, Complete Genomics, Ion Torrent, Roche, ABI, Life
Technologies, and PacBio are registered trademarks and all other brands
referenced in this document are the property of their respective owners.</p>
</div>
</div>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="index.html">
              <img class="logo" src="_static/html_logo.png" alt="Logo"/>
            </a></p>
  <h3><a href="index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Appendix</a><ul>
<li><a class="reference internal" href="#rtg-reference-file-format">RTG reference file format</a></li>
<li><a class="reference internal" href="#pedigree-ped-input-file-format">Pedigree PED input file format</a></li>
<li><a class="reference internal" href="#genetic-map-directory">Genetic map directory</a></li>
<li><a class="reference internal" href="#rtg-commands-using-indexed-input-files">RTG commands using indexed input files</a></li>
<li><a class="reference internal" href="#rtg-javascript-filtering-api">RTG JavaScript filtering API</a><ul>
<li><a class="reference internal" href="#vcf-record-field-access">VCF record field access</a><ul>
<li><a class="reference internal" href="#chrom-pos-id-ref-qual">CHROM, POS, ID, REF, QUAL</a></li>
<li><a class="reference internal" href="#alt-filter">ALT, FILTER</a></li>
<li><a class="reference internal" href="#info-info-field">INFO.{INFO_FIELD}</a></li>
<li><a class="reference internal" href="#sample-name-format-field">{SAMPLE_NAME}.{FORMAT_FIELD}</a></li>
</ul>
</li>
<li><a class="reference internal" href="#vcf-record-modification">VCF record modification</a></li>
<li><a class="reference internal" href="#vcf-header-modification">VCF header modification</a><ul>
<li><a class="reference internal" href="#ensureformatheader-format-header-string">ensureFormatHeader({FORMAT_HEADER_STRING})</a></li>
<li><a class="reference internal" href="#ensureinfoheader-info-header-string">ensureInfoHeader({INFO_HEADER_STRING})</a></li>
<li><a class="reference internal" href="#ensurefilterheader-filter-header-string">ensureFilterHeader({FILTER_HEADER_STRING})</a></li>
</ul>
</li>
<li><a class="reference internal" href="#testing-for-overlap-with-genomic-regions">Testing for overlap with genomic regions</a><ul>
<li><a class="reference internal" href="#regions-frombed-filename">Regions.fromBed({FILENAME})</a></li>
<li><a class="reference internal" href="#regions-fromvcf-filename">Regions.fromVcf({FILENAME})</a></li>
<li><a class="reference internal" href="#regions-object-overlaps-chrom-start-end">{REGIONS_OBJECT}.overlaps({CHROM}, {START}, {END})</a></li>
<li><a class="reference internal" href="#regions-object-encloses-chrom-start-end">{REGIONS_OBJECT}.encloses({CHROM}, {START}, {END})</a></li>
</ul>
</li>
<li><a class="reference internal" href="#additional-information-and-functions">Additional information and functions</a><ul>
<li><a class="reference internal" href="#samples">SAMPLES</a></li>
<li><a class="reference internal" href="#print-string">print({STRING})</a></li>
<li><a class="reference internal" href="#error-string">error({STRING})</a></li>
<li><a class="reference internal" href="#checkminversion-rtg-minimum-version">checkMinVersion(RTG_MINIMUM_VERSION)</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#distribution-contents">Distribution Contents</a></li>
<li><a class="reference internal" href="#readme-txt">README.txt</a></li>
<li><a class="reference internal" href="#notice">Notice</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="administration.html"
                        title="previous chapter">Administration &amp; Capacity Planning</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/appendix.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="administration.html" title="Administration &amp; Capacity Planning"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">RTG Tools Operations Manual v3.12</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">Appendix</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2017, Real Time Genomics.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.1.2.
    </div>
  </body>
</html>